let mainLand_array = [
    [27.32083, 88.91693],
    [27.54243, 88.76464],
    [28.00805, 88.83575],
    [28.1168, 88.62435],
    [27.86605, 88.14279],
    [27.82305, 87.19275],
    [28.11166, 86.69527],
    [27.90888, 86.45137],
    [28.15805, 86.19769],
    [27.88625, 86.0054],
    [28.27916, 85.72137],
    [28.30666, 85.11095],
    [28.59104, 85.19518],
    [28.54444, 84.84665],
    [28.73402, 84.48623],
    [29.26097, 84.11651],
    [29.18902, 83.5479],
    [29.63166, 83.19109],
    [30.06923, 82.17525],
    [30.33444, 82.11123],
    [30.385, 81.42623],
    [30.01194, 81.23221],
    [30.20435, 81.02536],
    [30.57552, 80.207],
    [30.73374, 80.25423],
    [30.96583, 79.86304],
    [30.95708, 79.55429],
    [31.43729, 79.08082],
    [31.30895, 78.76825],
    [31.96847, 78.77075],
    [32.24304, 78.47594],
    [32.5561, 78.40595],
    [32.63902, 78.74623],
    [32.35083, 78.9711],
    [32.75666, 79.52874],
    [33.09944, 79.37511],
    [33.42863, 78.93623],
    [33.52041, 78.81387],
    [34.06833, 78.73581],
    [34.35001, 78.98535],
    [34.6118, 78.33707],
    [35.28069, 78.02305],
    [35.49902, 78.0718],
    [35.50133, 77.82393],
    [35.6125, 76.89526],
    [35.90665, 76.55304],
    [35.81458, 76.18061],
    [36.07082, 75.92887],
    [36.23751, 76.04166],
    [36.66343, 75.85984],
    [36.73169, 75.45179],
    [36.91156, 75.39902],
    [36.99719, 75.14787],
    [37.02782, 74.56543],
    [37.17, 74.39089],
    [37.23733, 74.91574],
    [37.40659, 75.18748],
    [37.65243, 74.9036],
    [38.47256, 74.85442],
    [38.67438, 74.35471],
    [38.61271, 73.81401],
    [38.88653, 73.70818],
    [38.97256, 73.85235],
    [39.23569, 73.62005],
    [39.45483, 73.65569],
    [39.59965, 73.95471],
    [39.76896, 73.8429],
    [40.04202, 73.99096],
    [40.32792, 74.88089],
    [40.51723, 74.8588],
    [40.45042, 75.23394],
    [40.64452, 75.58284],
    [40.298, 75.70374],
    [40.35324, 76.3344],
    [41.01258, 76.87067],
    [41.04079, 78.08083],
    [41.39286, 78.39554],
    [42.03954, 80.24513],
    [42.19622, 80.23402],
    [42.63245, 80.15804],
    [42.81565, 80.25796],
    [42.88545, 80.57226],
    [43.02906, 80.38405],
    [43.1683, 80.81526],
    [44.11378, 80.36887],
    [44.6358, 80.38499],
    [44.73408, 80.51589],
    [44.90282, 79.87106],
    [45.3497, 81.67928],
    [45.15748, 81.94803],
    [45.13303, 82.56638],
    [45.43581, 82.64624],
    [45.5831, 82.32179],
    [47.20061, 83.03443],
    [46.97332, 83.93026],
    [46.99361, 84.67804],
    [46.8277, 84.80318],
    [47.0591, 85.52257],
    [47.26221, 85.70139],
    [47.93721, 85.53707],
    [48.39333, 85.76596],
    [48.54277, 86.59791],
    [49.1102, 86.87602],
    [49.09262, 87.34821],
    [49.17295, 87.8407],
    [48.98304, 87.89291],
    [48.88103, 87.7611],
    [48.73499, 88.05942],
    [48.56541, 87.99194],
    [48.40582, 88.51679],
    [48.21193, 88.61179],
    [47.99374, 89.08514],
    [47.88791, 90.07096],
    [46.95221, 90.9136],
    [46.57735, 91.07027],
    [46.29694, 90.92151],
    [46.01735, 91.02651],
    [45.57972, 90.68193],
    [45.25305, 90.89694],
    [45.07729, 91.56088],
    [44.95721, 93.5547],
    [44.35499, 94.71735],
    [44.29416, 95.41061],
    [44.01937, 95.34109],
    [43.99311, 95.53339],
    [43.28388, 95.87901],
    [42.73499, 96.38206],
    [42.79583, 97.1654],
    [42.57194, 99.51012],
    [42.67707, 100.8425],
    [42.50972, 101.8147],
    [42.23333, 102.0772],
    [41.88721, 103.4164],
    [41.87721, 104.5267],
    [41.67068, 104.5237],
    [41.58666, 105.0065],
    [42.46624, 107.4758],
    [42.42999, 109.3107],
    [42.64576, 110.1064],
    [43.31694, 110.9897],
    [43.69221, 111.9583],
    [44.37527, 111.4214],
    [45.04944, 111.873],
    [45.08055, 112.4272],
    [44.8461, 112.853],
    [44.74527, 113.638],
    [45.38943, 114.5453],
    [45.4586, 115.7019],
    [45.72193, 116.2104],
    [46.29583, 116.5855],
    [46.41888, 117.3755],
    [46.57069, 117.425],
    [46.53645, 117.8455],
    [46.73638, 118.3147],
    [46.59895, 119.7068],
    [46.71513, 119.9315],
    [46.90221, 119.9225],
    [47.66499, 119.125],
    [47.99475, 118.5393],
    [48.01125, 117.8046],
    [47.65741, 117.3827],
    [47.88805, 116.8747],
    [47.87819, 116.2624],
    [47.69186, 115.9231],
    [47.91749, 115.5944],
    [48.14353, 115.5491],
    [48.25249, 115.8358],
    [48.52055, 115.8111],
    [49.83047, 116.7114],
    [49.52058, 117.8747],
    [49.92263, 118.5746],
    [50.09631, 119.321],
    [50.33028, 119.36],
    [50.39027, 119.1386],
    [51.62083, 120.0641],
    [52.115, 120.7767],
    [52.34423, 120.6259],
    [52.54267, 120.7122],
    [52.58805, 120.0819],
    [52.76819, 120.0314],
    [53.26374, 120.8307],
    [53.54361, 123.6147],
    [53.18832, 124.4933],
    [53.05027, 125.62],
    [52.8752, 125.6573],
    [52.75722, 126.0968],
    [52.5761, 125.9943],
    [52.12694, 126.555],
    [51.99437, 126.4412],
    [51.38138, 126.9139],
    [51.26555, 126.8176],
    [51.31923, 126.9689],
    [51.05825, 126.9331],
    [50.74138, 127.2919],
    [50.31472, 127.334],
    [50.20856, 127.5861],
    [49.80588, 127.515],
    [49.58665, 127.838],
    [49.58443, 128.7119],
    [49.34676, 129.1118],
    [49.4158, 129.4902],
    [48.86464, 130.2246],
    [48.86041, 130.674],
    [48.60576, 130.5236],
    [48.3268, 130.824],
    [48.10839, 130.6598],
    [47.68721, 130.9922],
    [47.71027, 132.5211],
    [48.09888, 133.0827],
    [48.06888, 133.4843],
    [48.39112, 134.4153],
    [48.26713, 134.7408],
    [47.99207, 134.5576],
    [47.70027, 134.7608],
    [47.32333, 134.1825],
    [46.64017, 133.9977],
    [46.47888, 133.8472],
    [46.25363, 133.9016],
    [45.82347, 133.4761],
    [45.62458, 133.4702],
    [45.45083, 133.1491],
    [45.05694, 133.0253],
    [45.34582, 131.8684],
    [44.97388, 131.4691],
    [44.83649, 130.953],
    [44.05193, 131.298],
    [43.53624, 131.1912],
    [43.38958, 131.3104],
    [42.91645, 131.1285],
    [42.74485, 130.4327],
    [42.42186, 130.6044],
    [42.71416, 130.2468],
    [42.88794, 130.2514],
    [43.00457, 129.9046],
    [42.43582, 129.6955],
    [42.44624, 129.3493],
    [42.02736, 128.9269],
    [42.00124, 128.0566],
    [41.58284, 128.3002],
    [41.38124, 128.1529],
    [41.47249, 127.2708],
    [41.79222, 126.9047],
    [41.61176, 126.5661],
    [40.89694, 126.0118],
    [40.47037, 124.8851],
    [40.09362, 124.3736],
    [40.080673745035284, 124.35066998004915],
    [40.05661288357014, 124.33454990386964],
    [40.05356207694753, 124.33442115783693],
    [40.04673319519238, 124.33771491050722],
    [40.04350946250032, 124.34892117977144],
    [40.035463839219275, 124.36895728111269],
    [40.01676919406984, 124.37185406684877],
    [39.97069056853699, 124.35410857200623],
    [39.97302565957105, 124.34617996215822],
    [39.97372452693975, 124.34575080871583],
    [39.98005922810003, 124.34462964534761],
    [39.981123860660965, 124.34465646743776],
    [39.98301878336935, 124.34401810169221],
    [39.98443685817328, 124.34402346611024],
    [39.986031643367674, 124.34456527233125],
    [39.9875154178096, 124.3457454442978],
    [39.98772914443668, 124.34578299522401],
    [39.98781545692344, 124.34563815593721],
    [39.987852447955824, 124.34533774852754],
    [39.987741474798604, 124.34495687484743],
    [39.986866013570925, 124.34325098991395],
    [39.98674270827129, 124.3419635295868],
    [39.98354902348038, 124.33493614196779],
    [39.97797513101571, 124.32234048843384],
    [39.97669257813978, 124.3230700492859],
    [39.97225278615979, 124.3184405565262],
    [39.969226984896416, 124.31275427341461],
    [39.967097332503435, 124.3085539340973],
    [39.967714034036284, 124.30823743343355],
    [39.96753724683236, 124.29832935333253],
    [39.96778392652568, 124.29764807224275],
    [39.96830195098423, 124.29721355438232],
    [39.96867607731851, 124.29714918136598],
    [39.967352236478206, 124.2918223142624],
    [39.967159002907074, 124.29140925407411],
    [39.96674375444874, 124.2921656370163],
    [39.96415764540155, 124.29120540618898],
    [39.96376704809153, 124.28933858871461],
    [39.963750601840054, 124.28690314292909],
    [39.962410219044315, 124.28502023220064],
    [39.96085188822169, 124.28296566009523],
    [39.959708815592585, 124.28320705890657],
    [39.958068185151895, 124.28505241870882],
    [39.956517979371185, 124.28514897823335],
    [39.954396155344234, 124.2848324775696],
    [39.95180135470816, 124.28359866142274],
    [39.95049363657446, 124.28394198417665],
    [39.94993846565595, 124.28364694118501],
    [39.948893909639565, 124.2824023962021],
    [39.94828115085282, 124.28238093852998],
    [39.94747509737846, 124.28266525268556],
    [39.94629067504227, 124.28370594978334],
    [39.94563676642516, 124.28489685058595],
    [39.945612090505925, 124.28543329238893],
    [39.946068593571304, 124.28705334663393],
    [39.946159071294666, 124.28793847560884],
    [39.94598222836014, 124.28945124149324],
    [39.944559242993535, 124.29351210594179],
    [39.94425901397628, 124.29384469985963],
    [39.94360919871493, 124.29394125938417],
    [39.94332952948761, 124.2934960126877],
    [39.94249051494659, 124.29069042205812],
    [39.938961605860854, 124.28666174411775],
    [39.936337427280094, 124.28515434265138],
    [39.93420675059106, 124.28457498550416],
    [39.93210068837034, 124.28454816341402],
    [39.93059102967822, 124.28613603115083],
    [39.92774850292237, 124.28418874740602],
    [39.930632165233725, 124.27642107009889],
    [39.932701251780394, 124.26287591457368],
    [39.92799121242065, 124.24070477485658],
    [39.926691266765005, 124.23747003078462],
    [39.91912970112112, 124.22738492488863],
    [39.91465325574432, 124.2239409685135],
    [39.90913135482818, 124.22096908092499],
    [39.88624899010134, 124.21370029449464],
    [39.87000446080999, 124.21531498432161],
    [39.862469579375976, 124.21404361724855],
    [39.82912500650453, 124.17276978492738],
    [39.74297041796294, 124.15966987609865],
    [39.61178824068965, 124.09139692783357],
    [39.61199900559647, 124.08909022808076],
    [39.60499796126881, 123.94836008548738],
    [39.59600384557344, 123.92288982868196],
    [39.56646715856086, 123.86156380176546],
    [39.54900548897908, 123.7631803750992],
    [39.54585761957761, 123.68687152862549],
    [39.56198842374989, 123.604474067688],
    [39.56199255937249, 123.6036801338196],
    [39.55699241153044, 123.5666871070862],
    [39.54155130150262, 123.52019906044008],
    [39.531055341862846, 123.42796325683595],
    [39.530993279833815, 123.42590868473054],
    [39.50700835983626, 123.36753845214845],
    [39.5060067389577, 123.3658218383789],
    [39.448994045862484, 123.35492670536043],
    [39.3915946819134, 123.34706246852876],
    [39.312996508124485, 123.29578936100008],
    [39.3109752187623, 123.29551041126253],
    [39.27299567364124, 123.29989314079286],
    [39.22629015204951, 123.3752202987671],
    [39.156986778515666, 123.42696547508241],
    [39.050643617357025, 123.47667753696443],
    [38.89697827424865, 123.4021282196045],
    [38.83799028517641, 123.24543356895448],
    [38.82715052172, 123.1682986021042],
    [38.8356753779506, 123.0803167819977],
    [38.87300138260221, 122.9883921146393],
    [38.87300555901057, 122.98535048961641],
    [38.84499722588667, 122.90088772773744],
    [38.81507189445778, 122.81665027141572],
    [38.81500083764783, 122.69078493118288],
    [38.857776743547085, 122.56368041038515],
    [38.96598249796251, 122.45946586132051],
    [38.965999181718246, 122.45803356170656],
    [38.94564207813311, 122.36994981765748],
    [38.94898388091308, 122.27756381034852],
    [38.948996396732234, 122.27472066879274],
    [38.90350767284529, 122.21846401691438],
    [38.86798533904033, 122.12217271327974],
    [38.83298848688316, 122.08847343921663],
    [38.77131256718107, 122.05785870552064],
    [38.708281420430914, 121.988582611084],
    [38.67194547610158, 121.89928114414217],
    [38.66498854331656, 121.79243803024293],
    [38.62471636720691, 121.73288226127626],
    [38.60101677370052, 121.6637295484543],
    [38.59541977741509, 121.62661314010622],
    [38.59645116683508, 121.5549820661545],
    [38.61399509431025, 121.48311495780945],
    [38.613986711139944, 121.46319150924684],
    [38.610000402677166, 121.40949368476868],
    [38.60900693486031, 121.40771806240083],
    [38.55827569496317, 121.34147822856904],
    [38.53769706694235, 121.29228115081789],
    [38.523995694180016, 121.2217015028],
    [38.52299264281905, 121.21701300144197],
    [38.4599906589198, 121.1646616458893],
    [38.412046255231374, 121.1801862716675],
    [38.363876535463596, 121.18104457855226],
    [38.314037434719964, 121.16599202156068],
    [38.2777547370401, 121.15338027477266],
    [38.19699038144776, 121.08340144157411],
    [38.17134513381725, 121.12287282943727],
    [38.14523100802529, 121.15078926086427],
    [38.09408926633866, 121.18395745754243],
    [38.048800770864815, 121.19684278964998],
    [38.002799460660064, 121.19727194309236],
    [37.95891370557148, 121.18514299392702],
    [37.91499747909104, 121.15870714187623],
    [37.911996848933946, 121.16094410419466],
    [37.91100225480874, 121.16310596466064],
    [37.900001570368374, 121.22401893138887],
    [37.87138531966314, 121.29049479961397],
    [37.834001066200635, 121.33815228939058],
    [37.834005302970425, 121.36029124259949],
    [37.83299270807001, 121.38257503509523],
    [37.82638296061543, 121.42626821994783],
    [37.81512384186946, 121.46438241004945],
    [37.794062943376915, 121.50889635086061],
    [37.78499503236122, 121.52764499187471],
    [37.78499079277842, 121.55266463756563],
    [37.78451595796318, 121.56331300735475],
    [37.78399872371084, 121.57484650611879],
    [37.78342213044148, 121.58079028129579],
    [37.781319222752735, 121.59773111343385],
    [37.77231759298894, 121.63801789283754],
    [37.74480982878492, 121.70139312744142],
    [37.714512316364406, 121.74197494983675],
    [37.67374960182785, 121.77577078342439],
    [37.65899343675765, 121.78410172462465],
    [37.657991185064894, 121.78574860095979],
    [37.65900193035824, 121.80627286434175],
    [37.66099365286694, 121.81564986705781],
    [37.670047035551406, 121.8264538049698],
    [37.676976458459606, 121.83571279048921],
    [37.69192855925033, 121.85955226421358],
    [37.69998497188172, 121.87529146671297],
    [37.70099938960146, 121.8768471479416],
    [37.731196362045836, 121.92033112049104],
    [37.74943758268956, 121.95525348186494],
    [37.76110112285378, 121.98724150657655],
    [37.768361, 122.016928],
    [37.770248, 122.125450],
    [37.712534, 122.299767],
    [37.656988, 122.364714],
    [37.638992, 122.389529],
    [37.651990, 122.475816],
    [37.648498, 122.526971],
    [37.636006, 122.581791],
    [37.647772, 122.659864],
    [37.641515, 122.731758],
    [37.600763, 122.830796],
    [37.528987, 122.898961],
    [37.467577, 122.942059],
    [37.366465, 122.954118],
    [36.895379, 122.805309],
    [36.797137, 122.74382],
    [36.741523, 122.678527],
    [35.745436, 121.052470],
    [35.372587, 120.591478],
    [33.480270, 121.540750],
    [33.076763, 121.866407],
    [31.536124, 122.446408],
    [31.30889, 122.748726],
    [30.86432603710707, 123.33421468734743],
    [30.77893933627737, 123.38449001312257],
    [30.690146190433616, 123.38967204093935],
    [30.095951733005624, 123.15984964370729],
    [28.80120956032487, 122.47985601425172],
    [27.358256257643607, 121.32116317749025],
    [25.329403234573906, 120.12921631336214],
    [24.840791922622813, 119.64008867740633],
    [24.014886910555507, 118.38860213756561],
    [23.406398115633927, 117.85836160182954],
    [23.37308503307696, 117.8217387199402],
    [23.035249729041524, 117.34703063964845],
    [21.6267627140818, 114.05758023262025],
    [21.286140392693063, 112.48925507068634],
    [18.51173047678212, 110.63349366188051],
    [17.995478639453097, 109.7758573293686],
    [17.957515710821337, 109.5745360851288],
    [18.046378998379932, 109.08593416213989],
    [18.158992963606316, 108.82858693599702],
    [18.409240399710203, 108.49828362464906],
    [19.21224603284914, 108.3891659975052],
    [19.50121905668286, 108.50256443023683],
    [19.57356401876882, 108.6607074737549],
    [19.74698354434076, 108.88680160045625],
    [19.82571267855851, 108.94876599311829],
    [19.93471411414789, 109.00142312049867],
    [20.004644904667323, 109.0796685218811],
    [20.112767168523135, 109.25247788429262],
    [20.099992096866174, 109.39936101436616],
    [20.10000720994862, 109.40079867839815],
    [20.171989360329842, 109.51364994049074],
    [20.194984216739094, 109.6064865589142],
    [20.214995589135793, 109.6856278181076],
    [20.215997348712122, 109.706050157547],
    [20.247380869309723, 109.7043228149414],
    [20.313076962381277, 109.67205047607423],
    [20.393870667691452, 109.64870452880861],
    [20.477516719030042, 109.60853576660158],
    [20.527039435650707, 109.56150054931642],
    [20.578153221926044, 109.53643798828125],
    [20.631820343234708, 109.51789855957033],
    [20.706023311343692, 109.49249267578125],
    [20.702169504822308, 109.2089080810547],
    [20.709877019887912, 109.15225982666017],
    [20.73620807151256, 109.09046173095703],
    [20.772486038885056, 109.04617309570314],
    [20.825121749694063, 109.01012420654298],
    [20.879663749404116, 108.92807006835939],
    [20.963042616177393, 108.87897491455078],
    [21.023303016107928, 108.87039184570314],
    [21.12773936366297, 108.88275146484376],
    [21.202017409466812, 108.93733978271486],
    [21.2410624443489, 109.00291442871095],
    [21.29033403449086, 108.90575408935548],
    [21.341827593336323, 108.86180877685548],
    [21.390745715552566, 108.83777618408203],
    [21.396499714132478, 108.79486083984375],
    [21.390426042327263, 108.74233245849611],
    [21.39618005348398, 108.68877410888672],
    [21.417276156993662, 108.63075256347658],
    [21.374121781638873, 108.55899810791016],
    [21.34822304723749, 108.48827362060548],
    [21.353019454568628, 108.38596343994142],
    [21.353339209476527, 108.37841033935548],
    [21.318161989050616, 108.30905914306642],
    [21.302489421557606, 108.25412750244142],
    [21.29801123801481, 108.20503234863283],
    [21.275938197452824, 108.13533782958984],
    [21.456263962884414, 108.09422492980958],
    [21.45794148299227, 108.0941390991211],
    [21.470402456490127, 108.10117721557619],
    [21.49715799576202, 108.08469772338867],
    [21.510254436377277, 108.06950569152833],
    [21.515844021351064, 108.06615829467775],
    [21.54011629584494, 108.04615974426271],
    [21.54241, 107.99],
    [21.66694, 107.7831],
    [21.60526, 107.3627],
    [22.03083, 106.6933],
    [22.45682, 106.5517],
    [22.76389, 106.7875],
    [22.86694, 106.7029],
    [22.91253, 105.8771],
    [23.32416, 105.3587],
    [23.18027, 104.9075],
    [22.81805, 104.7319],
    [22.6875, 104.3747],
    [22.79812, 104.1113],
    [22.50387, 103.9687],
    [22.78287, 103.6538],
    [22.58436, 103.5224],
    [22.79451, 103.3337],
    [22.43652, 103.0304],
    [22.77187, 102.4744],
    [22.39629, 102.1407],
    [22.49777, 101.7415],
    [22.20916, 101.5744],
    [21.83444, 101.7653],
    [21.14451, 101.786],
    [21.17687, 101.2919],
    [21.57264, 101.1482],
    [21.76903, 101.099],
    [21.47694, 100.6397],
    [21.43546, 100.2057],
    [21.72555, 99.97763],
    [22.05018, 99.95741],
    [22.15592, 99.16785],
    [22.93659, 99.56484],
    [23.08204, 99.5113],
    [23.18916, 98.92747],
    [23.97076, 98.67991],
    [24.16007, 98.89073],
    [23.92999, 97.54762],
    [24.26055, 97.7593],
    [24.47666, 97.54305],
    [24.73992, 97.55255],
    [25.61527, 98.19109],
    [25.56944, 98.36137],
    [25.85597, 98.7104],
    [26.12527, 98.56944],
    [26.18472, 98.73109],
    [26.79166, 98.77777],
    [27.52972, 98.69699],
    [27.6725, 98.45888],
    [27.54014, 98.31992],
    [28.14889, 98.14499],
    [28.54652, 97.55887],
    [28.22277, 97.34888],
    [28.13618294983049, 97.32925415039064],
    [28.105903469076186, 97.34436035156251],
    [28.064709657296667, 97.30728149414064],
    [28.062285999812186, 97.37594604492189],
    [28.00895171255095, 97.41165161132814],
    [27.920407017871028, 97.38006591796875],
    [27.869430596394746, 97.37869262695314],
    [27.874286527892814, 97.32376098632814],
    [27.90584477608796, 97.30865478515626],
    [27.77226629694402, 97.09991455078126],
    [27.735807282370498, 97.09716796875001],
    [27.809927780908378, 97.04498291015625],
    [27.805068967813085, 96.99966430664062],
    [27.85486149620226, 96.96807861328126],
    [27.874286527892814, 96.89941406250001],
    [27.868216579514076, 96.86370849609376],
    [27.953164890693838, 96.71401977539064],
    [27.94952561755354, 96.68518066406251],
    [28.027136825828997, 96.62200927734376],
    [28.053802768216578, 96.57806396484375],
    [28.062285999812186, 96.50115966796876],
    [28.154346532344004, 96.427001953125],
    [28.12043868710109, 96.39404296875001],
    [28.137393951160096, 96.29379272460939],
    [28.223340035672134, 96.27593994140626],
    [28.188243641850313, 96.00540161132812],
    [28.29107973127882, 95.86944580078126],
    [28.266891924660545, 95.78842163085938],
    [28.272939391283685, 95.73898315429689],
    [28.164032516628076, 95.45059204101562],
    [28.127705557287978, 95.38055419921876],
    [27.919193572615065, 95.24871826171876],
    [27.593500626364456, 94.48242187500001],
    [27.580111845609515, 94.28466796875],
    [27.141034638587172, 93.84246826171875],
    [27.02610081008216, 93.83010864257814],
    [26.9967371231625, 93.72299194335939],
    [26.88410533221337, 93.06243896484376],
    [26.9196209739275, 92.9058837890625],
    [26.891454312354853, 92.801513671875],
    [26.95022893777318, 92.66143798828126],
    [26.852254230179813, 92.08602905273439],
    [26.980828590472107, 92.10662841796876],
    [27.0982539061379, 92.02560424804689],
    [27.235094607795503, 92.07229614257814],
    [27.253408742658372, 92.0379638671875],
    [27.270499215083454, 92.07778930664062],
    [27.272940496683695, 92.12585449218751],
    [27.46928747369202, 92.0159912109375],
    [27.48756291405129, 91.82373046875],
    [27.446134231502196, 91.75094604492189],
    [27.53262936554833, 91.59576416015626],
    [27.577677346218785, 91.56967163085938],
    [27.59958589534243, 91.58615112304689],
    [27.6312238466813, 91.56143188476564],
    [27.76472, 91.65776],
    [27.945, 91.66277],
    [28.08111, 91.30138],
    [27.96999, 91.08693],
    [28.07958, 90.3765],
    [28.24257, 90.38898],
    [28.32369, 89.99819],
    [28.05777, 89.48749],
    [27.32083, 88.91693]
];

let taiWan_array = [
    [21.55720026604179, 120.81527709960939],
    [21.76523910237092, 121.69624328613283],
    [21.80795831767072, 121.75872802734376],
    [21.871057412678223, 121.80198669433595],
    [21.950688152101726, 121.81709289550781],
    [22.698287544354052, 121.71821594238283],
    [23.454427847439103, 121.70928955078126],
    [24.554617992809813, 122.09106445312501],
    [25.484190857091647, 122.29705810546876],
    [25.70093788144429, 122.25929260253908],
    [25.76464852241932, 122.2167205810547],
    [25.812872679567928, 122.14393615722658],
    [25.827706934822306, 122.06359863281251],
    [25.81410893847997, 121.99012756347658],
    [25.245317016893644, 120.99346160888673],
    [23.925385389490568, 119.38842773437501],
    [23.477102759187964, 119.11651611328126],
    [23.39961407326111, 119.10209655761719],
    [23.296855923968202, 119.11514282226564],
    [23.249547872498646, 119.12818908691408],
    [23.05635732898977, 119.26757812500001],
    [22.1804109964903, 120.20416259765626],
    [21.616898513227195, 120.6731414794922],
    [21.571887678346233, 120.74008941650392],
]

function pointInChina(position = [31.172800343248, 121.406021546488]) {
    if (position.length !== 2) {
        console.error('The argument is an array of longitude and latitude, with longitude first and latitude last')
        return;
    }
    if ((position[0] < 3.85 || position[0] > 53.55) || (position[1] < 73.55) || position[1] > 135.08) {
        console.log('Must be abroad')
        return false;
    }

    function isInPolygon(checkPoint, polygonPoints) {
        var counter = 0;
        var i;
        var xinters;
        var p1, p2;
        var pointCount = polygonPoints.length;
        p1 = polygonPoints[0];
        for (i = 1; i <= pointCount; i++) {
            p2 = polygonPoints[i % pointCount];
            if (checkPoint[0] > Math.min(p1[0], p2[0]) && checkPoint[0] <= Math.max(p1[0], p2[0])) {
                if (checkPoint[1] <= Math.max(p1[1], p2[1])) {
                    if (p1[0] != p2[0]) {
                        xinters = (checkPoint[0] - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
                        if (p1[1] == p2[1] || checkPoint[1] <= xinters) {
                            counter++;
                        }
                    }
                }
            }
            p1 = p2;
        }
        if (counter % 2 == 0) {
            return false;
        } else {
            return true;
        }
    }

    try {
        let a = isInPolygon(position, mainLand_array);
        let b = isInPolygon(position, taiWan_array);
        if (a || b) {
            return true;
        } else {
            return false;
        }
    } catch (err) {
        console.log(err);
    }
}


function coorTransform(point = [], mapType = 0) {
    if( !pointInChina(point) ) {
        return point;
    }
    let p = [point[1], point[0]];
    let lat, lng;
    switch( mapType ) {
        case -2 :
            [lng, lat] = gcoord.transform(p, gcoord.BD09, gcoord.WGS84);
            return [lat, lng];
        case -1 :
            [lng, lat] = gcoord.transform(p, gcoord.GCJ02, gcoord.WGS84);
            return [lat, lng];
        case 0 :
            return point;
        case 1 :
            [lng, lat] = gcoord.transform(p, gcoord.WGS84, gcoord.GCJ02);
            return [lat, lng];
        case 2 :
            [lng, lat] = gcoord.transform(p, gcoord.WGS84, gcoord.BD09);
            return [lat, lng];
        default : 
            return point;
    }
}